<div class="container">
    <div class="row">
        <div class="span12">
            <div id="alert-area">

            </div>
        </div>
    </div>
    <div class="row">
        <div id="show" class="span12">
            <form class="form-search">
                <input type="text" id="q"/>
                <select name="field" id="field">
                    <option value="id_order">Id Order</option>
                    <option value="job_order">Job Order</option>
                    <option value="no_sj">No Sj</option>
                    <option value="consgnee">Consignee</option>
                    <option value="origin">Origin</option>
                    <option value="shipper">Shipper</option>
                    <option value="via">Via</option>
                    <option value="agent">Agent</option>
                    <option value="ctn">Ctn</option>
                    <option value="kg">Kg</option>
                    <option value="m3">M3</option>
                    <option value="etd_sin">ETD SIN</option>
                    <option value="eta_jkt">ETA JKT</option>
                    <option value="invoice">Invoice</option>
                    <option value="description">Description</option>
                    <option value="delivery">Delivery</option>
                    <option value="penerimaan">Penerimaan</option>
                    <option value="cost">Cost</option>
                    <option value="profit">Profit</option>
                    <option value="jatuh_tempo">Jatuh Tempo</option>
                    <option value="remarks">Remarks</option>
                    <option value="id_user1">Id User1</option>
                    <option value="id_user2">Id User2</option>
                    <option value="agree">Agree</option>
                </select>
                <a href="#" class="btn btn-primary" id="search">Search</a>
            </form>
            <div id="table">
                <?php $this->load->view('barang/show');
                ?>
            </div>
            <?php echo $this->pagination->create_links(); ?>
            <a href="<?php echo site_url() ?>pegawai1/input" class="btn btn-primary fancybox fancybox.iframe input">Input New</a>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#search").click(function(){
        q = $("#q").val();
        field = $("#field").val();
        $(".pagination").hide();
        
        if(q == ""){
            alert('Isi textbox terlebih dahulu');
        }else{
            $.post("<?php echo site_url('pegawai1/search'); ?>", { q:q, field:field }, function(data){
                $('#table').html(data);
            });
        }
    });
    
    $(document).ready(function() {
        $(".btnPrint").printPage();
    });
    function alertz (type, heading, message) {
        parent.$.fancybox.close();
        $.get('<?php echo site_url(); ?>pegawai1/show', function(data) {
            $('#table').html(data);
        });
        $("#alert-area").append($("<div class='alert-message alert alert-block " + type + " fade in' data-alert><a class='close' data-dismiss='alert' href='#'>&times;</a><h4 class='alert-heading'>"+ heading +"</h4><p> " + message + " </p></div>"));
        $(".alert-message").delay(1000).fadeOut("slow", function () { $(this).remove(); });
    }
</script>

